Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

url-search-params-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-search-params-polyfill

a simple polyfill for javascript URLSearchParams

  • 6.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is url-search-params-polyfill?

The url-search-params-polyfill package is a polyfill for the URLSearchParams interface, which allows you to work with the query string of a URL. This package is particularly useful for environments that do not support the URLSearchParams natively, such as older browsers.

What are url-search-params-polyfill's main functionalities?

Creating URLSearchParams

This feature allows you to create a new URLSearchParams object from a query string. The code sample demonstrates how to initialize the URLSearchParams with a query string.

const params = new URLSearchParams('key1=value1&key2=value2');

Appending Parameters

This feature allows you to append new key-value pairs to the URLSearchParams object. The code sample shows how to add a new parameter to the URLSearchParams.

const params = new URLSearchParams();
params.append('key', 'value');

Getting Parameter Values

This feature allows you to retrieve the value of a specific parameter from the URLSearchParams object. The code sample demonstrates how to get the value associated with a specific key.

const params = new URLSearchParams('key1=value1&key2=value2');
const value = params.get('key1');

Deleting Parameters

This feature allows you to delete a specific parameter from the URLSearchParams object. The code sample shows how to remove a parameter by its key.

const params = new URLSearchParams('key1=value1&key2=value2');
params.delete('key1');

Iterating Over Parameters

This feature allows you to iterate over all key-value pairs in the URLSearchParams object. The code sample demonstrates how to use a for...of loop to log each key-value pair.

const params = new URLSearchParams('key1=value1&key2=value2');
for (const [key, value] of params) {
  console.log(key, value);
}

Other packages similar to url-search-params-polyfill

Keywords

FAQs

Package last updated on 26 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc